<%@ Control Language="C#" AutoEventWireup="true" CodeFile="PanelGroupInput.ascx.cs" Inherits="admin_webparts_Plug_ins_Panel_PanelGroupInput" %>

<%@ Import Namespace="NTTHAO.Common.BL" %>
<%@ Import Namespace="NTTHAO.Web.BL.Panel" %>
<%@ Import Namespace="NTTHAO.CommonWeb" %>

<script type="text/javascript">
NTTHAO.namespace('page');

NTTHAO.page.langText = [];
NTTHAO.page.langText['BLANK_PANEL_GROUP_NAME'] = '<%=LanguageUtility.GetLanguageText("BLANK_PANEL_GROUP_NAME", Session)%>';
NTTHAO.page.langText['INVALID_NUMBER'] = '<%=LanguageUtility.GetLanguageText("INVALID_INT_NUMBER", Session)%>';

function doSubmit() {
    var txtName = document.getElementById("<%=this.txtName.ClientID %>");
    var txtDefaultWidth = document.getElementById("<%=this.txtDefaultWidth.ClientID %>");
    var txtDefaultHeight = document.getElementById("<%=this.txtDefaultHeight.ClientID %>");
    var txtMaxWidth = document.getElementById("<%=this.txtMaxWidth.ClientID %>");
    var txtMaxHeight = document.getElementById("<%=this.txtMaxHeight.ClientID %>");

    var errorMessage = "";

    errorMessage = CheckFieldString("noblank", txtName, NTTHAO.page.langText['BLANK_PANEL_GROUP_NAME']);
    if(errorMessage != "")
    {
        alert(errorMessage);
        txtName.select();
        txtName.focus();
        return false;
    }
    errorMessage = CheckFieldString("noblank", txtDefaultWidth, NTTHAO.page.langText['INVALID_NUMBER']);
    errorMessage += CheckFieldString("integer", txtDefaultWidth, NTTHAO.page.langText['INVALID_NUMBER']);
    if(errorMessage != "")
    {
        alert(errorMessage);
        txtDefaultWidth.select();
        txtDefaultWidth.focus();
        return false;
    }
    errorMessage = CheckFieldString("noblank", txtDefaultHeight, NTTHAO.page.langText['INVALID_NUMBER']);
    errorMessage += CheckFieldString("integer", txtDefaultHeight, NTTHAO.page.langText['INVALID_NUMBER']);
    if(errorMessage != "")
    {
        alert(errorMessage);
        txtDefaultHeight.select();
        txtDefaultHeight.focus();
        return false;
    }
    errorMessage = CheckFieldString("noblank", txtMaxWidth, NTTHAO.page.langText['INVALID_NUMBER']);
    errorMessage += CheckFieldString("integer", txtMaxWidth, NTTHAO.page.langText['INVALID_NUMBER']);
    if(errorMessage != "")
    {
        alert(errorMessage);
        txtMaxWidth.select();
        txtMaxWidth.focus();
        return false;
    }
    errorMessage = CheckFieldString("noblank", txtMaxHeight, NTTHAO.page.langText['INVALID_NUMBER']);
    errorMessage += CheckFieldString("integer", txtMaxHeight, NTTHAO.page.langText['INVALID_NUMBER']);
    if(errorMessage != "")
    {
        alert(errorMessage);
        txtMaxHeight.select();
        txtMaxHeight.focus();
        return false;
    }
    
    return true;
}
</script>
<style type="text/css">
    #spCancel1, #spSave, #spCancel2, #spSave2 {font-size:1.1em; font-weight: bold; }
    #spCancel1 button, #spSave button, #spCancel2 button, #spSave2 button { font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: bold; }
</style>

<div class="tip">
	<h1><%=LanguageUtility.GetLanguageText("PANEL_GROUP_INPUT", Session)%></h1>
</div>
<form id="frmInput" runat="server" onsubmit="return doSubmit();">
<p style="text-align: left;">
    <span id="spSave" class="yui-button yui-link-button yuibtn yuibtn-icon btnsave"><span class="first-child"><asp:Button ID="btnSave" runat="server" OnClick="btnSave_Click" Text="Save" /></span></span>
    <span id="spCancel1" class="yui-button yui-link-button yuibtn yuibtn-icon btncancel"><span class="first-child"><a href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>"><%=LanguageUtility.GetLanguageText("CANCEL", Session)%></a></span></span>
    <script type="text/javascript">
        YAHOO.util.Event.onContentReady("spSave", function () {
            var spSave = new YAHOO.widget.Button("spSave");
        });
        YAHOO.util.Event.onContentReady("spCancel1", function () {
            var spCancel1 = new YAHOO.widget.Button("spCancel1");
        });
    </script>
</p>
<table cellspacing="0" cellpadding="3" border="1" class="grid" style="margin: 10px auto;">
    <tr class="even">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("NAME", Session)%>:
        </td>
        <td>
            <asp:TextBox ID="txtName" runat="server" Width="400px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("DEFAULT_SIZE", Session)%>:</td>
        <td>
            <asp:TextBox ID="txtDefaultWidth" runat="server" Width="50px">100</asp:TextBox> x <asp:TextBox ID="txtDefaultHeight" runat="server" Width="50px">75</asp:TextBox> pixels
        </td>
    </tr>
    <tr class="even">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("MAX_SIZE", Session)%>:</td>
        <td>
            <asp:TextBox ID="txtMaxWidth" runat="server" Width="50px">100</asp:TextBox> x <asp:TextBox ID="txtMaxHeight" runat="server" Width="50px">75</asp:TextBox> pixels
        </td>
    </tr>
    <tr class="odd">
        <td align="right"><%=LanguageUtility.GetLanguageText("ACTIVE", Session)%>:</td>
        <td>
            <asp:CheckBox ID="chkActive" runat="server" Text="Active" Checked="true" /></td>
    </tr>
</table>
<p style="text-align: left;">
    <span id="spSave2" class="yui-button yui-link-button yuibtn yuibtn-icon btnsave"><span class="first-child"><asp:Button ID="btnSave2" runat="server" OnClick="btnSave_Click" Text="Save" /></span></span>
    <span id="spCancel2" class="yui-button yui-link-button yuibtn yuibtn-icon btncancel"><span class="first-child"><a href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>"><%=LanguageUtility.GetLanguageText("CANCEL", Session)%></a></span></span>
    <script type="text/javascript">
        YAHOO.util.Event.onContentReady("spSave2", function () {
            var spSave2 = new YAHOO.widget.Button("spSave2");
        });
        YAHOO.util.Event.onContentReady("spCancel2", function () {
            var spCancel2 = new YAHOO.widget.Button("spCancel2");
        });
    </script>
</p>
</form>
<script type="text/javascript">

YAHOO.util.Event.onDOMReady(function() {
    if(document.getElementById("<%=txtName.ClientID %>") != "") {
        document.getElementById("<%=txtName.ClientID %>").focus();
    }
});
</script>